import http from "./http";
//获取所有楼栋信息
export const building = () => {
  return http.request({
    url: "/classroom/get-building",
    method: "GET",
  });
};
//获取教室信息
export const getClassroom = (data) => {
  console.log(data);

  return http.request({
    url: `/classroom/get-classroom?building=${data.building}&startTime=${data.startTime}&endTime=${data.endTime}`,
    method: "GET",
  });
};
//获取评论信息
export const getComment = (data) => {
  return http.request({
    url: `/roomComment/get-room-comment?roomId=${data}`,
    method: "GET",
  });
};
//获取预约房间

//提交预约信息
export const booking = (data) => {
  return http.request({
    url: "/appointRecord/add",
    method: "POST",
    data,
  });
};
//获取不可预约时间段
export const getUnbookableTime = (data) => {
  return http.request({
    url: `/classroom/get-classroom-detail?roomId=${data}`,
    method: "GET",
  });
};
